(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)
split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))
merge([], xs) → xs
merge(xs, []) → xs
merge(cons(x, xs), cons(y, ys)) → ifmerge(leq(x, y), x, y, xs, ys)
ifmerge(tt, x, y, xs, ys) → cons(x, merge(xs, cons(y, ys)))
ifmerge(ff, x, y, xs, ys) → cons(y, merge(cons(x, xs), ys))
mergesort(xs) → mergesort1(split(xs))
mergesort1(app(xs, ys)) → merge(mergesort(xs), mergesort(ys))

Q is empty.

(1) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(2) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)
split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))
merge([], xs) → xs
merge(xs, []) → xs
merge(cons(x, xs), cons(y, ys)) → ifmerge(leq(x, y), x, y, xs, ys)
ifmerge(tt, x, y, xs, ys) → cons(x, merge(xs, cons(y, ys)))
ifmerge(ff, x, y, xs, ys) → cons(y, merge(cons(x, xs), ys))
mergesort(xs) → mergesort1(split(xs))
mergesort1(app(xs, ys)) → merge(mergesort(xs), mergesort(ys))

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LEQ(s(x), s(y)) → LEQ(x, y)
SPLIT(cons(x, cons(y, xs))) → SPLIT1(x, y, split(xs))
SPLIT(cons(x, cons(y, xs))) → SPLIT(xs)
MERGE(cons(x, xs), cons(y, ys)) → IFMERGE(leq(x, y), x, y, xs, ys)
MERGE(cons(x, xs), cons(y, ys)) → LEQ(x, y)
IFMERGE(tt, x, y, xs, ys) → MERGE(xs, cons(y, ys))
IFMERGE(ff, x, y, xs, ys) → MERGE(cons(x, xs), ys)
MERGESORT(xs) → MERGESORT1(split(xs))
MERGESORT(xs) → SPLIT(xs)
MERGESORT1(app(xs, ys)) → MERGE(mergesort(xs), mergesort(ys))
MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT1(app(xs, ys)) → MERGESORT(ys)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)
split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))
merge([], xs) → xs
merge(xs, []) → xs
merge(cons(x, xs), cons(y, ys)) → ifmerge(leq(x, y), x, y, xs, ys)
ifmerge(tt, x, y, xs, ys) → cons(x, merge(xs, cons(y, ys)))
ifmerge(ff, x, y, xs, ys) → cons(y, merge(cons(x, xs), ys))
mergesort(xs) → mergesort1(split(xs))
mergesort1(app(xs, ys)) → merge(mergesort(xs), mergesort(ys))

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 4 SCCs with 4 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SPLIT(cons(x, cons(y, xs))) → SPLIT(xs)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)
split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))
merge([], xs) → xs
merge(xs, []) → xs
merge(cons(x, xs), cons(y, ys)) → ifmerge(leq(x, y), x, y, xs, ys)
ifmerge(tt, x, y, xs, ys) → cons(x, merge(xs, cons(y, ys)))
ifmerge(ff, x, y, xs, ys) → cons(y, merge(cons(x, xs), ys))
mergesort(xs) → mergesort1(split(xs))
mergesort1(app(xs, ys)) → merge(mergesort(xs), mergesort(ys))

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(8) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SPLIT(cons(x, cons(y, xs))) → SPLIT(xs)

R is empty.
The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(10) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SPLIT(cons(x, cons(y, xs))) → SPLIT(xs)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • SPLIT(cons(x, cons(y, xs))) → SPLIT(xs)
    The graph contains the following edges 1 > 1

(13) YES

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LEQ(s(x), s(y)) → LEQ(x, y)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)
split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))
merge([], xs) → xs
merge(xs, []) → xs
merge(cons(x, xs), cons(y, ys)) → ifmerge(leq(x, y), x, y, xs, ys)
ifmerge(tt, x, y, xs, ys) → cons(x, merge(xs, cons(y, ys)))
ifmerge(ff, x, y, xs, ys) → cons(y, merge(cons(x, xs), ys))
mergesort(xs) → mergesort1(split(xs))
mergesort1(app(xs, ys)) → merge(mergesort(xs), mergesort(ys))

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(15) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LEQ(s(x), s(y)) → LEQ(x, y)

R is empty.
The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(17) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LEQ(s(x), s(y)) → LEQ(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LEQ(s(x), s(y)) → LEQ(x, y)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES

(21) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGE(cons(x, xs), cons(y, ys)) → IFMERGE(leq(x, y), x, y, xs, ys)
IFMERGE(tt, x, y, xs, ys) → MERGE(xs, cons(y, ys))
IFMERGE(ff, x, y, xs, ys) → MERGE(cons(x, xs), ys)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)
split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))
merge([], xs) → xs
merge(xs, []) → xs
merge(cons(x, xs), cons(y, ys)) → ifmerge(leq(x, y), x, y, xs, ys)
ifmerge(tt, x, y, xs, ys) → cons(x, merge(xs, cons(y, ys)))
ifmerge(ff, x, y, xs, ys) → cons(y, merge(cons(x, xs), ys))
mergesort(xs) → mergesort1(split(xs))
mergesort1(app(xs, ys)) → merge(mergesort(xs), mergesort(ys))

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(22) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(23) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGE(cons(x, xs), cons(y, ys)) → IFMERGE(leq(x, y), x, y, xs, ys)
IFMERGE(tt, x, y, xs, ys) → MERGE(xs, cons(y, ys))
IFMERGE(ff, x, y, xs, ys) → MERGE(cons(x, xs), ys)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(24) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

(25) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGE(cons(x, xs), cons(y, ys)) → IFMERGE(leq(x, y), x, y, xs, ys)
IFMERGE(tt, x, y, xs, ys) → MERGE(xs, cons(y, ys))
IFMERGE(ff, x, y, xs, ys) → MERGE(cons(x, xs), ys)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.

(26) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


IFMERGE(tt, x, y, xs, ys) → MERGE(xs, cons(y, ys))
IFMERGE(ff, x, y, xs, ys) → MERGE(cons(x, xs), ys)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial Order [NEGPOLO,POLO] with Interpretation:

POL( IFMERGE(x1, ..., x5) ) = 2x1 + x4 + x5 + 2


POL( leq(x1, x2) ) = 2


POL( 0 ) = 2


POL( tt ) = 2


POL( s(x1) ) = 2x1 + 1


POL( ff ) = 2


POL( MERGE(x1, x2) ) = x1 + x2 + 2


POL( cons(x1, x2) ) = x2 + 2



The following usable rules [FROCOS05] were oriented:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)

(27) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGE(cons(x, xs), cons(y, ys)) → IFMERGE(leq(x, y), x, y, xs, ys)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.

(28) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(29) TRUE

(30) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT(xs) → MERGESORT1(split(xs))
MERGESORT1(app(xs, ys)) → MERGESORT(ys)

The TRS R consists of the following rules:

leq(0, x) → tt
leq(s(x), 0) → ff
leq(s(x), s(y)) → leq(x, y)
split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))
merge([], xs) → xs
merge(xs, []) → xs
merge(cons(x, xs), cons(y, ys)) → ifmerge(leq(x, y), x, y, xs, ys)
ifmerge(tt, x, y, xs, ys) → cons(x, merge(xs, cons(y, ys)))
ifmerge(ff, x, y, xs, ys) → cons(y, merge(cons(x, xs), ys))
mergesort(xs) → mergesort1(split(xs))
mergesort1(app(xs, ys)) → merge(mergesort(xs), mergesort(ys))

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(31) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(32) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT(xs) → MERGESORT1(split(xs))
MERGESORT1(app(xs, ys)) → MERGESORT(ys)

The TRS R consists of the following rules:

split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))

The set Q consists of the following terms:

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

We have to consider all minimal (P,Q,R)-chains.

(33) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

leq(0, x0)
leq(s(x0), 0)
leq(s(x0), s(x1))
merge([], x0)
merge(x0, [])
merge(cons(x0, x1), cons(x2, x3))
ifmerge(tt, x0, x1, x2, x3)
ifmerge(ff, x0, x1, x2, x3)
mergesort(x0)
mergesort1(app(x0, x1))

(34) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT(xs) → MERGESORT1(split(xs))
MERGESORT1(app(xs, ys)) → MERGESORT(ys)

The TRS R consists of the following rules:

split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))
split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))

The set Q consists of the following terms:

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))

We have to consider all minimal (P,Q,R)-chains.

(35) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

split1(x, y, app(xs, ys)) → app(cons(x, xs), cons(y, ys))

Used ordering: Polynomial interpretation [POLO]:

POL(MERGESORT(x1)) = 1 + x1   
POL(MERGESORT1(x1)) = x1   
POL(app(x1, x2)) = 1 + x1 + x2   
POL(cons(x1, x2)) = 1 + 2·x1 + 2·x2   
POL(nil) = 0   
POL(split(x1)) = 1 + x1   
POL(split1(x1, x2, x3)) = 2 + 2·x1 + 2·x2 + 2·x3   

(36) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT(xs) → MERGESORT1(split(xs))
MERGESORT1(app(xs, ys)) → MERGESORT(ys)

The TRS R consists of the following rules:

split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)
split(cons(x, cons(y, xs))) → split1(x, y, split(xs))

The set Q consists of the following terms:

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))

We have to consider all minimal (P,Q,R)-chains.

(37) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

split(cons(x, cons(y, xs))) → split1(x, y, split(xs))

Used ordering: Polynomial interpretation [POLO]:

POL(MERGESORT(x1)) = 2·x1   
POL(MERGESORT1(x1)) = x1   
POL(app(x1, x2)) = 2·x1 + 2·x2   
POL(cons(x1, x2)) = 2 + 2·x1 + 2·x2   
POL(nil) = 0   
POL(split(x1)) = 2·x1   
POL(split1(x1, x2, x3)) = 2 + x1 + 2·x2 + 2·x3   

(38) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT(xs) → MERGESORT1(split(xs))
MERGESORT1(app(xs, ys)) → MERGESORT(ys)

The TRS R consists of the following rules:

split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)

The set Q consists of the following terms:

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))
split1(x0, x1, app(x2, x3))

We have to consider all minimal (P,Q,R)-chains.

(39) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

split1(x0, x1, app(x2, x3))

(40) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT(xs) → MERGESORT1(split(xs))
MERGESORT1(app(xs, ys)) → MERGESORT(ys)

The TRS R consists of the following rules:

split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)

The set Q consists of the following terms:

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.

(41) Narrowing (EQUIVALENT transformation)

By narrowing [LPAR04] the rule MERGESORT(xs) → MERGESORT1(split(xs)) at position [0] we obtained the following new rules [LPAR04]:

MERGESORT(nil) → MERGESORT1(app(nil, nil))
MERGESORT(cons(x0, nil)) → MERGESORT1(app(cons(x0, nil), nil))

(42) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT1(app(xs, ys)) → MERGESORT(ys)
MERGESORT(nil) → MERGESORT1(app(nil, nil))
MERGESORT(cons(x0, nil)) → MERGESORT1(app(cons(x0, nil), nil))

The TRS R consists of the following rules:

split(nil) → app(nil, nil)
split(cons(x, nil)) → app(cons(x, nil), nil)

The set Q consists of the following terms:

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.

(43) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(44) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT1(app(xs, ys)) → MERGESORT(ys)
MERGESORT(nil) → MERGESORT1(app(nil, nil))
MERGESORT(cons(x0, nil)) → MERGESORT1(app(cons(x0, nil), nil))

R is empty.
The set Q consists of the following terms:

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.

(45) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

split(nil)
split(cons(x0, nil))
split(cons(x0, cons(x1, x2)))

(46) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(xs)
MERGESORT1(app(xs, ys)) → MERGESORT(ys)
MERGESORT(nil) → MERGESORT1(app(nil, nil))
MERGESORT(cons(x0, nil)) → MERGESORT1(app(cons(x0, nil), nil))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(47) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule MERGESORT1(app(xs, ys)) → MERGESORT(xs) we obtained the following new rules [LPAR04]:

MERGESORT1(app(nil, nil)) → MERGESORT(nil)
MERGESORT1(app(cons(z0, nil), nil)) → MERGESORT(cons(z0, nil))

(48) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(xs, ys)) → MERGESORT(ys)
MERGESORT(nil) → MERGESORT1(app(nil, nil))
MERGESORT(cons(x0, nil)) → MERGESORT1(app(cons(x0, nil), nil))
MERGESORT1(app(nil, nil)) → MERGESORT(nil)
MERGESORT1(app(cons(z0, nil), nil)) → MERGESORT(cons(z0, nil))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(49) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule MERGESORT1(app(xs, ys)) → MERGESORT(ys) we obtained the following new rules [LPAR04]:

MERGESORT1(app(nil, nil)) → MERGESORT(nil)
MERGESORT1(app(cons(z0, nil), nil)) → MERGESORT(nil)

(50) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT(nil) → MERGESORT1(app(nil, nil))
MERGESORT(cons(x0, nil)) → MERGESORT1(app(cons(x0, nil), nil))
MERGESORT1(app(nil, nil)) → MERGESORT(nil)
MERGESORT1(app(cons(z0, nil), nil)) → MERGESORT(cons(z0, nil))
MERGESORT1(app(cons(z0, nil), nil)) → MERGESORT(nil)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(51) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs with 1 less node.

(52) Complex Obligation (AND)

(53) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(nil, nil)) → MERGESORT(nil)
MERGESORT(nil) → MERGESORT1(app(nil, nil))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(54) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = MERGESORT(nil) evaluates to t =MERGESORT(nil)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Matcher: [ ]
  • Semiunifier: [ ]




Rewriting sequence

MERGESORT(nil)MERGESORT1(app(nil, nil))
with rule MERGESORT(nil) → MERGESORT1(app(nil, nil)) at position [] and matcher [ ]

MERGESORT1(app(nil, nil))MERGESORT(nil)
with rule MERGESORT1(app(nil, nil)) → MERGESORT(nil)

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(55) NO

(56) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGESORT1(app(cons(z0, nil), nil)) → MERGESORT(cons(z0, nil))
MERGESORT(cons(x0, nil)) → MERGESORT1(app(cons(x0, nil), nil))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.